cmake_minimum_required(VERSION 2.8)

PROJECT ( SoftwareRenderer )


find_package(Qt4 REQUIRED ${ARGN})
include(${QT_USE_FILE})
if (QT4_FOUND)
	include_directories( 
		"${QT_INCLUDE_DIR}" 
		"${QT_INCLUDE_DIR}/QtCore"
	)
	link_libraries(${QT_LIBRARIES})
else(QT4_FOUND)
	message(FATAL_ERROR "Can not build SaLsA Simulation without qt")
endif(QT4_FOUND)


FIND_PACKAGE(OpenCV REQUIRED core highgui)
IF (OpenCV_FOUND)
	include_directories(${OpenCV_INCLUDE_DIRS})
	link_libraries(${OpenCV_LIBS})
ELSE()
	message(WARNING "Could not find Package OpenCV most of the modules will not be build")    
ENDIF()

	
set(ENABLE_SSE true)
set(ENABLE_SSE3 true)
set(ENABLE_SSE41 true)
set(ENABLE_SSE42 true)
include(Utils.cmake)
include(DetectCompiler.cmake)	
include(CompilerOptions.cmake)

add_subdirectory(OgMath)

set(MATH_INCLUDE_DIR "${OgMath_SOURCE_DIR}/include")
set(MATH_LIBRARY OgMath)
add_definitions(-DUSE_OgMath)

add_subdirectory(objLoader)
add_subdirectory(Rasterizer)
add_subdirectory(ScanLineRasterizer)
add_subdirectory(ScanLineRasterizerMT)
add_subdirectory(TestProgram)